<? 
if($action != ACTION_SAVE_TEAM) {
	
	$t_id_team = $_GET['id_team'];
	
	if($t_id_team != "") {
	  $query = getTeam($t_id_team);
	  $fetch = MySQL_Fetch_Array($query);
	  $t_nazev = $fetch["NAZEV"];
	  $t_zkratka = $fetch["ZKRATKA"];
	  $t_trida = $fetch["TRIDA"];
	} else {
	  $t_nazev = "";
	  $t_zkratka = "";
	  $t_trida = 0;
	}
}

?>
<form action="<? echo redirect_str(PAGE_ADMIN_TEAM).action(ACTION_SAVE_TEAM); ?>" method="post">
  
  <input type="hidden" name="t_id_team" value="<? echo $t_id_team;?>">
  
  <fieldset>
    <legend><? echo ($t_id_team!=""?"úprava mužstva":"nové mužstvo"); ?></legend>
    
    <table class="panel-70">
      <tr>
        <td class="righted">název <span class="star">*</span></td>
        <td><input class='text px170' type='text' name="t_nazev" value="<? echo $t_nazev;?>"></td>
      </tr>
      
      <tr>
        <td class="righted">zkratka <span class="star">*</span></td>
        <td><input class='text px70' type='text' name="t_zkratka" maxlength="3" value="<? echo $t_zkratka;?>"></td>
      </tr>
      
      <tr>
        <td class="righted">třída</td>
        <td>
          <select class='text' name='t_trida' size=1>
            <option value='0'>není</option>
            <?
            for($i=2; $i<=4; $i++){
                  if($i == $t_trida) echo "<option value='$i' selected>$i</option>";
                  else echo "<option value='$i'>$i</option>";
            }
            ?>
          </select>
        </td>
      </tr>
      
      <tr>
        <td colspan="2">
        <div class="center">
        	<input class="button" onmouseover="this.className='button_hover'" 
       			onmouseout="this.className='button'" type="submit" value="ULOŽIT">
       		<a class="button preloader" href="<? echo redirect_str(PAGE_ADMIN_TEAMS); ?>">ZRUŠIT</a>
        </div>
        </td>
      </tr>
    </table>
  </fieldset>
</form>

